Method of and apparatus for controlling a servomotor

ABSTRACT

A servomotor control method capable of preventing an overshoot in positioning a movable part of a machine in the case where the position of the movable part is controlled in a full-closed loop. When an output P1 of a first acceleration/deceleration processing section of a bell-type acceleration/deceleration process becomes &#34;0&#34;, a coefficient k3 of incomplete integration is set to a relatively small value α, and a torque limit value TL is set to a relatively small value TLL. The incomplete integration is performed with the coefficient k3 set to the small value, and a torque command TC is limited to the small value, so that an output of the servomotor is reduced and torsion of a mechanical system between the servomotor and the mechanical movable part is canceled. When both the outputs P1 and P2 of the acceleration/deceleration processing sections become &#34;0&#34;, the coefficient k3 is set to a relatively large value β, and a torque limit value is made larger, to perform the incomplete integration. Then, the output torque of the servomotor is increased gradually to position the movable part at the designated position.

TECHNICAL FIELD

The present invention relates to a method of controlling a servomotorfor driving a feed shaft of a machine tool, etc., and more specifically,to a servomotor control method for preventing an overshoot during apositional feedback control in which the position of a movable partdriven by the feed shaft is detected by a position detector such as ascale detector.

BACKGROUND ART

In positioning control of a feed shaft of a machine tool and the likeusing a servomotor, according to a conventional method for preventing anovershoot during positioning, the output torque of a servomotor isreduced by decreasing a value of an integrator in a velocity loop when aposition deviation becomes close to "0" (i.e., a movable part of themachine comes close to a commanded position), to thereby reduce theovershoot.

However, in a full-closed loop control, the position of the movable partdriven by the feed shaft is detected by a position detector such as ascale detector for performing a positional feedback control based on thedetected position. Further, in a case of such control a mechanicalsystem between the servomotor and the position detector such as a scaledetector may have an insufficient rigidity. If so, then the servomotorwill, due to the torsion of the mechanical system, advance too much byan amount corresponding to the torsion at the time when the positiondeviation has become close to "0" and the movable part has reached thecommanded position. That is, when the rigidity of the mechanical systembetween the servomotor and the position detector is insufficient, themovable part is driven while the mechanical system is distorted. Theresult is that, when the position is detected by the position detectoras being the commanded position, the servomotor actually takes aposition which makes the movable part to advance beyond the commandedtarget position by the amount corresponding to the torsion of themechanical system. When the position deviation becomes "0" and thepositioning is completed to stop the rotation of the servomotor, thetorsion of the mechanical system is released gradually, causing themechanical movable part to move further forward by the amountcorresponding to the torsion of the mechanical system (in the samedirection as it has been moving), thereby to overshoot the commandedtarget position. As the movable part of the machine moves forward, theposition deviation increases. Therefore, in order to cancel the increasein the position deviation, the servomotor moves in the oppositedirection, so that the movable part is positioned at the commandedtarget position. Thus, in the full-closed loop positional control, themovable part tends to overshoot the commanded position due to thetorsion of the movable part.

SUMMARY OF THE INVENTION

An object of the present invention is to prevent an overshoot of amovable part of a machine or to reduce an overshooting amount whenpositional control is performed in a full-closed loop.

A servomotor control method of the present invention comprises the stepsof: detecting a position of a movable part of a machine, which is drivenby a servomotor through a mechanical system; controlling a position ofthe movable part using a motion command distributed from a numericalcontrol device and the detected position of the movable part by afeedback control system including a position loop; and positioning themovable part so that torsion of the mechanical system between theservomotor and the movable part is released by reducing a torque commandfor the servomotor for a period immediately before termination of themotion command inputted to the position loop.

In the case where the motion command distributed from the numericalcontrol device is subjected to the acceleration/deceleration process byan acceleration/deceleration processing section and then inputted to theposition loop, the torque command for the servomotor is reduced when aninput to the acceleration/deceleration processing section becomes zero.In the case where the acceleration/deceleration processing section is ofa bell type composed of first and second acceleration/decelerationprocessing sections, the torque command for the servomotor is reducedwhen an output of the first acceleration/deceleration processing sectionbecomes zero. In the case where the acceleration/deceleration process isnot performed on the motion command distributed from the numericalcontrol device, a signal indicating that it is time immediately beforetermination of the motion command is delivered at a predetermined timebefore the motion command terminates or when the remaining amount of themotion command becomes a predetermined value or smaller, and the torquecommand for the servomotor is reduced when the signal is delivered.

In order to reduce the torque command, the value of an integrator in avelocity loop of the feedback control system is decreased and/or atorque limit value of a torque limit circuit for limiting the torquecommand is decreased. In order to decrease the value of the integrator,an integral value for the present processing period of the position andvelocity feedback control is obtained using a product of an integralvalue in the last processing period and a predetermined constant whichis equal to or larger than 0 but smaller than 1. This means that theintegration performed in the velocity loop is changed to an incompleteintegration. Then, after the motion command is wholly inputted to theposition loop, the predetermined constant is changed to a value which islarger than the predetermined value but smaller than 1, to therebygradually increase the torque command.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a flowchart of processing to be performed in each period ofposition and velocity loop processing according to a first embodiment ofthe present invention;

FIG. 2 is a flowchart of processing to be performed in each period ofposition and velocity loop processing according to a second embodimentof the present invention;

FIG. 3 is a block diagram showing essential elements of a servo controlsystem for performing a servomotor control method according to the firstembodiment of the present invention;

FIGS. 4a through 4d are diagrams showing relation among a motioncommand, outputs of acceleration/deceleration processing and an outputof an integrator according to the first embodiment;

FIG. 5 is a block diagram of control hardware for performing the presentinvention;

FIG. 6 is a graph showing a result of an experiment on positioningcontrol according to a conventional method; and

FIG. 7 is a graph showing a result of an experiment on positioningcontrol according to the present invention.

DETAILED DESCRIPTION OF THE INVENTION

FIG. 3 is a block diagram showing essential elements of a servo controlsystem according to a first embodiment of the present invention. In thisembodiment, a bell-type acceleration/deceleration process is composed oftwo linear acceleration/deceleration processing sections. That first andsecond acceleration/deceleration processing sections, is 9a and 9b areadopted for the acceleration/deceleration processing. A motion commandP0 distributed from a control device such as a CNC (computerizednumerical control) device is inputted to the firstacceleration/deceleration processing section 9a. An output P1 of thefirst acceleration/deceleration processing section 9a is inputted to thesecond acceleration/deceleration processing section 9b to obtain anoutput P2 of the second processing section 9b. The output P2 of thesecond acceleration/deceleration processing section 9b, which serves asa motion command for a position loop processing, is inputted in an errorcounter 11 for addition. Meanwhile a position feedback value Pf from adetector, such as a scale attached to a movable part of the machine, isinputted to the error counter 11 for subtraction, whereby a positiondeviation is obtained. The position deviation stored in the errorcounter 11 is multiplied by a position loop gain Kp to obtain a velocitycommand Vc, and a velocity feedback value Vf from a detector, such as ascale, is subtracted from the velocity command Vc to obtain a velocitydeviation. Then, the product of a value obtained by integrating thevelocity deviation by an integrator 10 and an integral gain k1 is addedto the product of the velocity deviation and a proportional gain toobtain a torque command Tc, thereby executing PI(proportional-plus-integral) controlled velocity loop processing. Thetorque command Tc obtained by the velocity loop process is delivered,through a torque limit circuit 12 and as a torque command Tc' notexceeding a predetermined value, to an electric current loop to performa current loop process (not shown) to drive a servomotor and therebydrive the mechanical movable part.

The servo control process of the present embodiment, as so far describedis substantively the same as that of conventional systems. However, thepresent embodiment differs from the conventional system in that thevalue in the integrator 10 is reduced for a period immediately beforethe motion command inputted to the error counter 11 becomes "0". In thepresent embodiment, when the motion command P1 outputted from the firstacceleration/deceleration processing section becomes "0", theintegration to be performed in the integrator 10 is changed toincomplete integration, so that a coefficient of a smaller value can beused (from 0 to a value less than 1). Then, when the output P2 of thesecond acceleration/deceleration processing section 9b becomes "0", thecoefficient for the incomplete integration in the integrator 10 ischanged to a slightly larger value, and after a predetermined time haspassed the normal integration is resumed. Further, when the output P1 ofthe first acceleration/deceleration processing section becomes "0", atorque limit value for the torque limit circuit 12 is changed to asmaller value, and when the output P2 of the secondacceleration/deceleration processing section becomes "0", the torquelimit value is changed back to a normal, larger value.

FIGS. 4a through 4d are time charts respectively showing states of theinput and output of the first and second acceleration/decelerationprocessing sections 9a and 9b and a state of the integrator 10 in thepositioning control. When the distributed motion amount P0 outputtedfrom a host control device comes to an end (see FIG. 4a), the output P1of the first acceleration/deceleration processing section 9a decreaseslinearly (see FIG. 4b). The output P1 of the firstacceleration/deceleration processing section 9a is inputted to thesecond acceleration/deceleration processing section 9b, and the outputP2 of the second acceleration/deceleration processing section 9bdecreases smoothly as shown in FIG. 4c. The integrator 10 performs anormal integration while the output P1 of the firstacceleration/deceleration processing section is not "0". However, whenthe output P1 becomes "0", the integrator 10 shifts to an incompleteintegration so that an integral value close to "0" is outputted. Whenthe output P2 of the second acceleration/deceleration processing section9b becomes "0", the integrator 10 starts to slightly increase thecoefficient of the incomplete integration, to thereby gradually increasethe output (see FIG. 4d).

As is understood from the above, in the positioning control, while themotion command is maintained, the output of the integrator 10 is set toa small value, to thereby decrease a value of the torque command Tc.Further, the torque command Tc is limited to a small value by the torquelimit circuit 12. Thus, the output torque of the servomotor is decreasedso that the torsion of the mechanical system between the servomotor andthe mechanical movable part is released. When the value of positiondeviation stored in the error counter 11 becomes nearly "0" to completethe positioning, the torsion of the mechanical system has almost beenvanished, so that the mechanical movable part is positioned at acommanded position without overshooting.

FIG. 5 is a block diagram showing essential elements of a drive controlsystem for a servomotor of a machine tool and the like for performingthe present embodiment. In FIG. 5, a computerized numerical control(CNC) device 1, provided as a control device for controlling a machinetool and the like, distributes a motion command to each feed shaft ofthe machine tool and the like according to an operation program and thelike. A shared RAM 2 is provided for mediating information between aprocessor of the CNC 1 and a processor of a digital servo circuit 3,delivers, on one hand, data such as a motion command written by the CNC1 to the processor of the digital servo circuit 3. On the other hand,the RAM 2 delivers alarm information and the like written by theprocessor of the digital servo circuit 3 to the host processor of theCNC 1. The digital servo circuit 3, in the form of a digital signalprocessor (DSP), includes a processor, a ROM, a RAM, etc., and controlsthe servomotor of each feed shaft of the machine tool and the like.Reference numeral 4 designates a servo amplifier in the form of atransistor inverter, and reference numeral 5 designates a servomotor. Toa mechanical movable part 7, which is driven by the servomotor 5 througha feed shaft 6, is attached a position and velocity detector 8, such asa scale and the like. A signal from the position and velocity detector 8(information of position Pf and velocity Vf) is fed back to the digitalservo circuit 3. Since the structure of the control system shown in FIG.5 is the same as that of conventional servo control systems whichperform control in the full-closed loop mode, details are omitted.

FIG. 1 is a flowchart of processing to be performed by the processor ofthe digital servo circuit 3 in each period of position and velocity loopprocessing according to the present embodiment.

The processor of the digital servo circuit 3 reads the distributedmotion command amount supplied from the CNC 1 through the shared RAM 2,obtains the command amount P0 in each period of position and velocityloop processing (Step S1), and performs a bell-typeacceleration/deceleration processing similar to that of conventionalcases. That is, the processing by the first acceleration/decelerationprocessing section is performed based on the motion command amount P0 tooutput the command amount P1, and then the processing by the secondacceleration/deceleration processing section is performed using thecommand amount P1 to obtain the command amount P2 (Step S2). Then, it isdetermined whether or not each command amount P0, P1 and P2 is "0"(Steps S3 through S5). If no motion command is outputted from the CNC 1and thus the distributed motion command amount is "0", all the commandamounts P0, P1 and P2 are "0". Therefore, after processings of Steps S3,S4 and S5 are performed, the control proceeds to Step S17, where thetorque limit value TL is set to a normal limit value (high-level value)TLH and a coefficient k3 of incomplete integration (described later) isset to a predetermined parameter value β. Then, the control proceeds toStep S7. At Step S7, "1" is added to a counter C. The counter C is setto the countable maximum value at the time of its initialization,performed when the power is turned on, and is designed so that, when itcounts to that maximum value, it keeps that value instead of countingup.

Next, the position deviation is obtained based on the command amount P2outputted from the second acceleration/deceleration processing sectionand a position feedback signal Pf from the scale 8. The position loopprocessing is performed in a manner similar to conventional cases, tothereby obtain a velocity command Vc. Further, a velocity feedback valueVf, supplied from the scale 8, is read (Step S9), and it is determinedwhether or not the counter C shows a value not exceeding a predeterminedvalue C0 (Step S10). As described above, when the power is turned on,the counter C is set to the maximum value, so that the value of thecounter C is larger than the predetermined value C0. Therefore, theprocedure proceeds from Step S10 to Step S12, and processing of theintegrator 10 is performed. That is, a complete integration is performedin a manner that the velocity deviation, the value obtained bysubtracting the velocity feedback value Vf read at Step S9 from thevelocity command Vc obtained at Step S8, is multiplied by the integralgain k1, and the product is added to the integral value Sum, stored inthe register. Then, the product of the velocity deviation (Vc-Vf) andthe proportional gain k2 is added to the integral value Sum to obtain atorque command Tc (Step S13). Next, it is determined whether or not thetorque command Tc exceeds the predetermined torque limit value TL (StepS14). If the torque command Tc does not exceed the torque limit valueTL, the torque command Tc is delivered to the current loop (Step S16).If the torque command Tc exceeds the torque limit value TL, the value oftorque command Tc is replaced by the torque limit value TL (Step S15)and delivered to the current loop, to bring the processing for thepresent period of position and velocity loop processing to an end.

When the distributed motion command amount is not outputted from the CNC1, the processing of Steps S1 through S5, S17, S7 through S10 and S12through S16 is performed repeatedly in each period.

When the distributed motion command amount is outputted from the CNC 1,the procedure proceeds to Step S17 after performing the processing ofSteps S1 through S3. The processing of Steps S7 through S10 and StepsS12 through 16 is then preformed as described above, to end the positionand velocity loop processing for the present period.

Thereafter, the processing of Steps S1 through S3, S17 and S7 throughS16 is performed in each period. When the output of the distributedmotion command amount from the CNC 1 ends, and the motion command amountP0 becomes "0", the procedure proceeds from Step S3 to Step S4 todetermine whether or not the output P1 of the firstacceleration/deceleration processing section is "0". If the output P1 isnot "0", the processing of Step S17 and Step S7 and downward asdescribed above is performed. When the output P1 of the firstacceleration/deceleration processing section becomes "0", the procedureproceeds from Step S4 to Step S5 to determine whether or not the commandamount P2, which is the output of the second acceleration/decelerationprocessing section, is "0". Since the command amount P2 is at first not"0", the procedure proceeds from Step S5 to Step S6, where the counter Cis reset to "0" and the coefficient k3 of incomplete integration is setto a predetermined parameter value α. Further, the torque limit value TLis set to a lower-level value TLL, which is so determined as to releaseand remove the torsion of the mechanical system which has occurred whenpositioning is completed. Here, the predetermined values TLL and TLH, towhich the torque limit value TL is selectively set, have the relation ofTLL<TLH, and the parameter values α and β, to which the coefficient k3of incomplete integration is selectively set, have the relation of0≦α<β<1.

After the processing of Step S6 is performed, the processing of Step S7and the subsequent steps is performed. Here, since the counter C isreset to "0", the set value in the counter C is determined to be lessthan the set value C0 at Step S10, so that the control proceeds to StepS11, and the incomplete integration is performed. That is, to obtain theintegral value sum of the present period, the product of the velocitydeviation (Vc-Vf) and the integral gain k1 is added to the product ofthe integral value Sum, which is stored in the register, and thecoefficient k3, which is set to α at Step S6. The parameter value α ispredetermined to be among small values including "0". For example, ifthe α is predetermined to be "0", the integral value Sum of the presentperiod is [k1(Vc-Vf)], which is a very small value. Thus, as shown inFIG. 4d, the integral value is very small in the section where theoutput P1 of the first acceleration/deceleration processing section is"0" and the output P2 of the second acceleration/deceleration processingsection is not "0".

Then the product of the velocity deviation (Vc-Vf) and the integral gaink1 is added to the integral value Sum as described above, to therebyobtain a torque command Tc (Step S13). In other words, the torquecommand Tc is obtained by the velocity loop processing based on theincomplete integration, so that it has a small value. Further, in thepresent embodiment, the torque limit value TL is set to the low-levelvalue TLL at Step S6, so that the value of torque command Tc obtained atStep S13 exceeds the torque limit value TL (=TLL) when compared in StepS14. The torque command Tc is then limited to that torque limit value TL(=TLL) (Step S15). If the value of torque command Tc does not exceed thetorque limit value TL, the torque command Tc obtained at Step S13 isdelivered, directly as it is, to the current loop (Step S16).

Thereafter, while the commanded amount P1, which is the output of thefirst acceleration/deceleration processing section, is "0", and thecommanded amount P2 from the second acceleration/deceleration processingsection is not "0", (that is, while the motion amount is not accumulatedin the first acceleration/deceleration processing section but the motionamount is still accumulated in the second acceleration/decelerationprocessing section), the counter C is set to "0", the coefficient k3 isset to a small value a and the torque limit value TL is set to alow-level value TLL at Step S6. Therefore, the control proceeds fromStep S10 to Step S11, where the incomplete integration is performed toobtain the torque command Tc. Further, since the torque command Tc islimited to the value not exceeding the torque limit value TL, which isset to the low-level toque limit value TLL, the output torque of theservomotor is made small. Thereby, the torsion of the mechanical system,such as the feed shaft 6 which lies between the servomotor 5 and themechanical movable part 7, is gradually canceled.

Then, when the commanded amount P2 from the secondacceleration/deceleration processing section also becomes "0", thecontrol proceeds from Step S5 to Step S17, where the torque limit valueTL is set to a high-level normal value TLH, and the coefficient k3 ofthe incomplete integration is set to β (Step S17). Then, the processingof Step S7 and the following steps is performed in each period. In thiscase, since the processing of Step S6 is skipped, the counter C iscounted up in each period, and while the value of the counter C does notexceed the predetermined value C0, the control proceeds from Step S10 toStep S11, where the incomplete integration is performed with thecoefficient k3 set to β.

As described above, while the output P1 of the firstacceleration/deceleration processing section is "0" and the output P2 ofthe second acceleration/deceleration processing section is not "0", thetorque command Tc takes a small value so that the output torque of theservomotor 5 is small. Therefore, the servomotor 5 can not follow up themotion command, causing the position deviation in the error counter 11to increase. Therefore, the velocity command Vc corresponding to theposition deviation is obtained at Step S8, and the velocity loopprocessing is performed based on the obtained velocity command Vc. Sincethe integration performed in that velocity loop processing is theincomplete integration in Step S11, the integral value Sum increases bya small amount, that is, increases gradually. As a result, the torquecommand value Tc also increases gradually, so that the positiondeviation stored in the error counter 11 diminishes gradually, and themechanical movable part 7 moves to the designated target position.

When the value of the counter C exceeds the predetermined value C0, thecontrol proceeds from Step S10 to Step S12, where the normal, completeintegration is performed. Thereafter, the processings of Steps S1through S5, S17, S7 through S10, S12 and S13 through S16 are performedin each period to complete the positioning to the commanded position.When a new motion command is outputted from the CNC 1, the processing asdescribed above is performed again.

In the present embodiment, the bell-type acceleration/decelerationprocessing is adopted as the acceleration/deceleration processing.Utilizing the outputs of the first and second acceleration/decelerationprocessing sections 9a and 9b, the point at which the output P1 of thefirst acceleration/deceleration processing section 9a becomes "0" andthe output P2 of the second acceleration/deceleration processing section9b is not "0", is made to be recognized to be the point slightly beforethe end of the motion command. In order to decrease the output torque ofthe servomotor from that time on, the coefficient k3 of the incompleteintegration is changed to a smaller value (for example, "0"), and thetorque limit value TL is also made smaller. By doing so, the outputtorque of the servomotor 5 is diminished, and the resulting state iskept while the output P1 of the first acceleration/decelerationprocessing section 9a is "0" and the output P2 of the secondacceleration/deceleration processing section 9b is not "0". The torsionof the mechanical system is thereby cancelled. After both outputs P1 andP2 of the first and second acceleration/deceleration processing sections9a and 9b become "0", and the output of the motion command to the servocontrol processing (circuit) is completed, the incomplete integration isperformed during a predetermined time (a time determined by thepredetermined value C0) with the coefficient k3 made a little larger.Thereby, the output torque of the servomotor is prevented fromincreasing too rapidly, preventing torsion or shocks from occurring tothe mechanical system.

In the case in which the bell-type acceleration/deceleration processingis not employed, but the normal acceleration/deceleration processing(having only one stage thereof) is performed, the output torque of theservomotor is diminished from the point at which the input of theacceleration/deceleration processing is "0" and the output thereof isnot "0". When the output of the acceleration/deceleration processingbecomes "0", the incomplete integration with a little larger coefficientk3 is preformed until a time determined by the predetermined value C0has passed. That is, in the flowchart of FIG. 1,acceleration/deceleration processing of only one stage is performed inStep S2, and, using the obtained output, for example, as P2, the controlproceeds from Step S3 to Step S5 skipping Step S4.

Further, the present invention is applicable either to the case in whichthe acceleration/deceleration processing is not performed or to the casein which the acceleration/deceleration processing is performed but theinput and output thereof are not utilized. An example of such cases isshown by the flowchart of FIG. 2. Since the example shown in FIG. 2 isthe case in which the acceleration/deceleration processing is notperformed, the processing of Step S2 in FIG. 1 is not included. Theprocessing of Step S1 in FIG. 1 corresponds to and is the same as theprocessing of Step T1 in FIG. 2. The processings of Steps S3 through S5in FIG. 1 correspond to the processing of Step T2 in FIG. 2, though theyare different only with respect to this point. The processing of Step S6in FIG. 1 corresponds to and is the same as the processing of Step T3 inFIG. 2, and the processing of Step S17 in FIG. 1 is the same as theprocessing of Step T14 in FIG. 2. Further, the processing of Step S7 anddownward in FIG. 1 corresponds to and is the same as the processing ofStep T4 and downward in FIG. 2.

In this embodiment, the CNC 1 sets a flag F to "1", at a predeterminednumber of periods before the distribution of the motion command iscompleted, and sets the flag F to "0" when the distribution iscompleted. When the CNC 1 reads the command velocity and the motioncommand amount from an operation program, the number of distributionperiods through which the motion command amount is to be outputted iscalculated. Thus, the period in which the distribution of the motioncommand is completed can be known, and the period which is apredetermined number of periods before the period in which thedistribution is completed can be also known. Thus, when that periodcomes, the flag F is set up. Alternatively, the point at which the flagF is to be set up can be determined based on the remainder of the motioncommand amount. Further, a reference value for remainder of the motionamount may be predetermined so that when the remainder of the motioncommand amount has become smaller than the reference value while the CNCoutputs the motion command in each distribution period, the flag F isset up.

The motion command P0 in the position and velocity loop processingperiod is obtained based on the motion command amount distributed by theCNC 1 (Step T1). Then, it is determined whether or not the flag F is setto "1" in the shared RAM (Step S2), and if the flag is not set to "1",the procedure proceeds to Step T14, where the torque limit value TL isset to the normal high-level value TLH, and the coefficient k3 of theincomplete integration is set to β, which is the same processing as inStep S17 in FIG. 1. Then the processing of Step T4 and subsequent steps,which are the same as the processing of Step S7 and subsequent steps inFIG. 1, is performed. Then, when the processing progresses to a point,which is a predetermined number of periods before the period at whichthe distribution of the motion command is completed, the flag F is setto "1". When the flag F set to "1" is detected in Step T2, the procedureproceeds to Step T3, where the same processing as that of Step S6 inFIG. 1 is performed. That is, the counter C is reset to "0", thecoefficient k3 of the incomplete integration is set to α, and the torquelimit value TL is set to the low-level value TLL. Then, the processingof Step T4 and the subsequent steps is performed. In the period, whichis a predetermined number of periods before the period in which thedistribution of the motion command is completed, the incompleteintegration at Step T10 is performed with such coefficient k3 of theincomplete integration that is set to a small parameter value α (forexample, "0"), to thereby keep the integral value Sum at a small value.Further, the torque command Tc is limited to the low-level torque limitvalue TLL or under (Steps T11 and T12) to thereby drive the servomotor.Therefore, the output torque of the servomotor 5 is kept at a low level,whereby the torsion of the mechanical system (6) is canceled. When thedistribution of the motion amount is completed, and the flag F is set to"0", the torque limit value TLH, is reset to the normal, high-levelvalue TLH and the coefficient of the incomplete integration is set to β(Step T14). Thus, the incomplete integration is performed with thecoefficient k3 until the value of the counter C exceeds thepredetermined value C0 (Step T8), so that the output torque of theservomotor 5 is increased gradually, avoiding a rapid increase in theoutput torque. When the value of the counter C exceeds the predeterminedvalue C0, the normal complete integration is performed (Step T9) toposition the mechanical movable part 7 at the commanded position.

In the above described two embodiments, the output torque of theservomotor is decreased by decreasing the integral value obtained byintegration in the velocity loop and by also limiting the value of thetorque command to a value smaller than the torque limit value. Theoutput torque of the servomotor may, however, be decreased either bydecreasing the integral value or by decreasing torque limit value to asmaller value. In the case in which the output torque of the servomotoris decreased only by the torque limit value, the torque limit value isreduced to a smaller value from the point, which is a predetermined timebefore the point at which the whole motion command has been inputted inthe servo control system (servo circuit)(the whole motion command hasbeen inputted in the error counter 11), until the point at which theinput of the whole motion command is completed. After the input of thewhole motion command is completed, the torque limit value is increasedto a little larger value or is increased gradually, before apredetermined time (predetermined value C0) has passed. When thepredetermined time has passed, the torque limit value is reset to anormal large torque limit value.

FIGS. 6 and 7 show the result of an experiment performed for verifyingthe effect of the present invention. FIG. 6 shows the result of anexperiment wherein the positioning is performed not by applying thepresent invention but by a conventional method FIG. 7 shows the resultof an experiment wherein the positioning is performed by applying thefirst embodiment of the present invention. In FIGS. 6 and 7, theabscissa represents time, the ordinate represents the position of themechanical movable part, wherein "0" represents the target position, andthe feed velocity is set to 10 mm/min. In FIG. 7, the time constant ofthe acceleration/deceleration processing section is set to 64 ms, thatof the first acceleration/deceleration processing section and that ofsecond acceleration/deceleration processing section being 32 msrespectively.

In the case of FIG. 6, where the conventional method is used,overshooting of 0.6 mm or so occurs, while in the case of FIG. 7 wherethe present invention is applied, overshooting is only 0.2 mm or so,thereby indicating that overshooting can be reduced by the presentinvention.

According to the present invention, when the position of a mechanicalmovable part is controlled in a full-closed loop, the positioning isperformed in a manner that the torsion of a mechanical system such as afeed shaft between the servomotor and the mechanical movable part can bereduced. Therefore, overshooting can be prevented or reduced.

We claim:
 1. A method of controlling a servomotor for driving a movablepart of a machine through a mechanical system, based on a first motioncommand distributed from a numerical control device, the methodcomprising the steps of:detecting a position of the movable part;controlling a position of the movable part using the first motioncommand and the position of the movable part detected in the detectingstep by a feedback control system including a position loop; andpositioning the movable part so that torsion of the mechanical systembetween the servomotor and the movable part is released by reducing atorque command for the servomotor for a period immediately beforetermination of a second motion command input to the position loop, theperiod commencing upon occurrence of a predetermined indicationpreceding termination of the second motion command.
 2. A method ofcontrolling a servomotor according to claim 1, wherein:the feedbackcontrol system comprises an acceleration/deceleration processingsection, the controlling step includes the steps of:performing anacceleration/deceleration process of the first motion command by theacceleration/deceleration processing section; and outputting the motioncommand obtained by the acceleration/deceleration process in theacceleration/deceleration process step to the position loop as thesecond motion command, and the positioning step includes a step ofreducing the torque command for the servomotor when an input to theacceleration/deceleration processing section becomes zero.
 3. A methodof controlling a servomotor for driving a movable part of a machinethrough a mechanical system, based on a first motion command distributedfrom a numerical control device, the method comprising the stepsof:detecting a position of the movable part; controlling a position ofthe movable part using the first motion command and the position of themovable part detected in the detecting step by a feedback control systemincluding a position loop; and positioning the movable part so thattorsion of the mechanical system between the servomotor and the movablepart is released by reducing a torque command for the servomotor for aperiod immediately before termination of a second motion command inputto the position loop, the period commencing upon occurrence of apredetermined indication preceding termination of the second motioncommand; wherein: the feedback control system comprises a firstacceleration/deceleration processing section and a secondacceleration/deceleration processing section; and the controlling stepincludes the steps of:performing an acceleration/deceleration process ofthe first motion command by the first acceleration/-decelerationprocessing section and further performing an acceleration/decelerationprocess by the second acceleration/deceleration processing section, andoutputting the motion command obtained by the acceleration/-decelerationprocesses in the acceleration/deceleration process step to the positionloop as the second command; and the positioning step includes the stepof reducing the torque command for the servomotor when an output of thefirst acceleration/deceleration processing section becomes zero.
 4. Amethod of controlling a servomotor for driving a movable part of amachine through a mechanical system, based on a first motion commanddistributed from a numerical control device, the method comprising thesteps of:detecting a position of the movable part; controlling aposition of the movable part using the first motion command and theposition of the movable part detected in the detecting step by afeedback control system including a position loop; positioning themovable part so that torsion of the mechanical system between theservomotor and the movable part is released by reducing a torque commandfor the servomotor for a period immediately before termination of asecond motion command input to the position loop, the period commencingupon occurrence of a predetermined indication preceding termination ofthe second motion command; and delivering a predetermined signal at apredetermined time before the second motion command terminates; whereinthe positioning step includes a step of reducing the torque command forthe servomotor when the predetermined signal is delivered.
 5. A methodof controlling a servomotor for driving a movable part of a machinethrough a mechanical system, based on a first motion command distributedfrom a numerical control device, the method comprising the stepsof:detecting a position of the movable part; controlling a position ofthe movable part using the first motion command and the position of themovable part detected in the detecting step by a feedback control systemincluding a position loop; positioning the movable part so that torsionof the mechanical system between the servomotor and the movable part isreleased by reducing a torque command for the servomotor for a periodimmediately before termination of a second motion command input to theposition loop, the period commencing upon occurrence of a predeterminedindication preceding termination of the second motion command; anddelivering a signal indicating a time immediately before termination ofthe first motion command when the remainder of the first motion commandamount is not greater than a predetermined value; wherein thepositioning step includes a step of reducing the torque command for theservomotor when the signal is delivered.
 6. A method of controlling aservomotor for driving a movable part of a machine through a mechanicalsystem, based on a first motion command distributed from a numericalcontrol device, the method comprising the steps of:detecting a positionof the movable part; controlling a position of the movable part usingthe first motion command and the position of the movable part detectedin the detecting step by a feedback control system including a positionloop; and positioning the movable part so that torsion of the mechanicalsystem between the servomotor and the movable part is released byreducing a torque command for the servomotor for a period immediatelybefore termination of a second motion command input to the positionloop, the period commencing upon occurrence of a predeterminedindication preceding termination of the second motion command; whereinthe feedback control system includes a velocity loop and the positioningstep includes the step of reducing the torque command by decreasing avalue of an integrator in the velocity loop.
 7. A method of controllinga servomotor according to claim 6, wherein the positioning step includesthe step of obtaining an integral value for the present processingperiod of a position and velocity feedback control using a product of anintegral value in the last processing period and a predeterminedconstant which is equal to or larger than 0 but smaller than
 1. 8. Amethod of controlling a servomotor according to claim 7, furthercomprising the step of gradually increasing the torque command bychanging the predetermined constant to a value larger than a presentvalue of the predetermined constant but smaller than 1 after the secondmotion command is wholly inputted to the position loop.
 9. A method ofcontrolling a servomotor for driving a movable part of a machine througha mechanical system, based on a first motion command distributed from anumerical control device, the method comprising the steps of:detecting aposition of the movable part; controlling a position of the movable partusing the first motion command and the position of the movable partdetected in the detecting step by a feedback control system including aposition loop; and positioning the movable part so that torsion of themechanical system between the servomotor and the movable part isreleased by reducing a torque command for the servomotor for a periodimmediately before termination of a second motion command input to theposition loop, the period commencing upon occurrence of a predeterminedindication preceding termination of the second motion command; whereinthe feedback control system includes a torque limit circuit for limitingthe torque command, and the positioning step includes the step ofreducing the torque command by decreasing a limit value of the torquelimit circuit.
 10. A method of controlling a servomotor according toclaim 1, wherein the predetermined indication is one ofthe first motioncommand, provided as an input signal to an acceleration/decelerationprocessing operation, becoming zero while an output signal thereof isnonzero, commencement of a predetermined time interval beforetermination of the second motion command, and a remaining amount of thesecond motion command becoming less than or equal to a predeterminedvalue.
 11. A method of controlling a servomotor according to claim 10,wherein the acceleration/deceleration processing operation is a secondacceleration/deceleration processing operation subsequent to a firstacceleration/deceleration processing operation, and the input signal tothe second acceleration/deceleration processing operation is an outputsignal from the first acceleration/deceleration operation.
 12. A servocontrol system for controlling a servomotor to drive a movable part of amachine through a mechanical system, based on a first motion commanddistributed from a numerical control device, said systemcomprising:means for detecting a position of the movable part; means,including a feedback control system including a position loop, forcontrolling a position of the movable part using the feedback controlsystem and in accordance with the first motion command and the positionof the movable part detected by said detecting means; and means forpositioning the movable part so that torsion of the mechanical systembetween the servomotor and the movable part is released by reducing atorque command for the servomotor for a period immediately beforetermination of a second motion command input to the position loop, theperiod commencing upon occurrence of a predetermined indicationpreceding termination of the second motion command.
 13. A servo controlsystem according to claim 12, wherein:the feedback control systemfurther includes an acceleration/deceleration processing section forperforming an acceleration/deceleration process of the first motioncommand to obtain the second motion command; said controlling meansfurther includes means for outputting the second motion command obtainedby the acceleration/deceleration processing section to the positionloop; and said positioning means includes means for reducing the torquecommand for the servomotor when an input to theacceleration/deceleration processing section becomes zero.
 14. A servocontrol system according to claim 12, wherein:the feedback controlsystem further includesa first acceleration/deceleration processingsection for performing a first acceleration/deceleration process on thefirst motion command to generate a first output signal, and a secondacceleration/deceleration processing section for performing a secondacceleration/deceleration process on the first output signal to generatea second output signal as the second motion command; said controllingmeans further comprises means for outputting the second output signal tothe position loop; and said positioning means includes means forreducing the torque command for the servomotor when the first outputsignal becomes zero.
 15. A computer-readable medium encoded with aprogram for controlling a servomotor to drive a movable part of amachine through a mechanical system, based on a first motion commanddistributed from a numerical control device, said program comprising thefunctions of:detecting a position of the movable part; controlling aposition of the movable part using a feedback control system including aposition loop and in accordance with the first motion command and theposition of the movable part detected by the detecting function; andpositioning the movable part so that torsion of the mechanical systembetween the servomotor and the movable part is released by reducing atorque command for the servomotor for a period immediately beforetermination of a second motion command input to the position loop, theperiod commencing upon occurrence of a predetermined indicationpreceding termination of the second motion command.
 16. Acomputer-readable medium according to claim 15, wherein:the feedbackcontrol system further includes an acceleration/deceleration processingsection for performing an acceleration/deceleration process of the firstmotion command to obtain the second motion command; the controllingfunction includes a function for outputting the second motion commandobtained by the acceleration/deceleration process of theacceleration/-deceleration processing section to the position loop; andthe positioning function includes a function for reducing the torquecommand for the servomotor when an input to theacceleration/deceleration processing section becomes zero.
 17. Acomputer-readable medium according to claim 15, wherein:the feedbackcontrol system further includesa first acceleration/decelerationprocessing section for performing a first acceleration/decelerationprocess on the first motion command to generate a first output signal,and a second acceleration/deceleration processing section for performinga second acceleration/deceleration process on the first output signal togenerate a second output signal as the second motion command; thecontrolling function further comprises a function for outputting thesecond output signal to the position loop; and the positioning functionincludes a function for reducing the torque command for the servomotorwhen the first output signal becomes zero.
 18. A servomotor drivecontrol system for controlling a servomotor to drive a movable partthrough a mechanical system coupled between the servomotor and themovable part, said servomotor drive control system comprising:anumerical controller for distributing a first motion command for theservomotor; and a digital servo control circuit for receiving the firstmotion command, obtain therefrom a second motion command, and reducing atorque command for the servomotor for a period immediately beforetermination of the second motion command, the period commencing uponoccurrence of a predetermined indication preceding termination of thesecond motion command; whereby the movable part is positioned so thattorsion of the mechanical system is released as the movable part isdriven by the servomotor.